home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 4.5 KB | 117 lines | [TEXT/MPS ] |
- // UFloatWindow.h
- // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
-
- #ifndef __UFLOATWINDOW__
- #define __UFLOATWINDOW__
-
- //----------------------------------------------------------------------------------------
- // Theory of Operation
- //
- // UFloatWindow a number of services to support floating windows, including the
- // TFloatWindow base class which provides floating window capabilities to MacApp windows.
- // Floating windows are distinguished from other windows in the application heap by the
- // value of the windowKind field of the windowPeek record. The windowKind values 128-999
- // are reserved by MacApp. For now, windowKind values of 128 are used to indicate that a
- // window is a floating window.
- //
- // To use this unit, call InitUFloatWindow from your main program (i.e.
- // M<your>Application.cp) after calling InitUMacApp. This routine ensures that the class
- // TFloatWindow is registered so it can be created by name from strings in view resources,
- // and sets gUFloatWindowInitialized to true.
- //
- // N.B.: The MacApp team wishes to thank Dean Yu for the use of his excellent DEVELOP
- // article and source code to support floating window operation.
- //
- // To create a floating window:
- //
- // For template views, it's business as usual: specify the name of the window class,
- // "TFloatWindow", in the window's view description resource and call NewTemplateWindow
- // as usual.
- //
- // For non-template views, call this unit's NewFloatPaletteWindow, instead of
- // NewPaletteWindow; call this unit's NewFloatSimpleWindow, instead of NewSimpleWindow;
- // and call this unit's NewFloatTWindow, instead of NewTWindow.
- //
- // You probably want to use the floating windoid WDEF so you get something that looks
- // like a standard floating window. For this you need to use the definitions in
- // "FloatWindow.h". See DemoDialogs for examples.
- //----------------------------------------------------------------------------------------
-
- // MacApp
-
- #ifndef __UWINDOW__
- #include "UWindow.h"
- #endif
-
-
- //----------------------------------------------------------------------------------------
- // Forward and external class declarations.
- //----------------------------------------------------------------------------------------
-
- class TDocument;
-
- //----------------------------------------------------------------------------------------
- // Object Signatures: These follow the same reservation rules as resource types The
- // signature is used to search the signature table and create an object "by signature"If
- // the signature's entry in the table has been updated with a new class then an object of
- // that class will be created.
- //----------------------------------------------------------------------------------------
-
- const IDType kStdFloatWindow = 'fwnd';
-
- //----------------------------------------------------------------------------------------
- // TFloatWindow
- //----------------------------------------------------------------------------------------
-
- class TFloatWindow : public TWindow
- {
- MA_DECLARE_CLASS;
-
- public:
- TFloatWindow();
- // Constructor
- virtual ~TFloatWindow();
- // Destructor
-
- void IFloatWindow(TDocument* itsDocument,
- WindowRef itsWMgrWindow,
- Boolean canResize,
- Boolean canClose,
- Boolean disposeOnFree);
-
- //------------------------------------------------------------------------------------
- // Standard signature support.
- //------------------------------------------------------------------------------------
-
- virtual IDType GetStandardSignature(); // override
- // Returns this class's standard signature.
-
- //------------------------------------------------------------------------------------
- // Stream I/O protocol support.
- //------------------------------------------------------------------------------------
-
- virtual void ReadFields(TStream* aStream);
-
- virtual WindowRef GetBehindWindowPtr();
- // returns WindowRef(-1)
-
- virtual void Close(); // Override
- // Overridden to fix up the target, since no deactivation occurs
- };
-
-
- //----------------------------------------------------------------------------------------
- // Global function declaraions
- //----------------------------------------------------------------------------------------
-
- extern void InitUFloatWindow();
- // Unit initialization
-
- //----------------------------------------------------------------------------------------
- // Global variable declarations
- //----------------------------------------------------------------------------------------
-
- extern Boolean gUFloatWindowInitialized;
-
- #endif
-